3.1.15 \(\int \frac {(a+b \sin (c+d x^2))^2}{x} \, dx\) [15]

Optimal. Leaf size=74 \[ -\frac {1}{4} b^2 \cos (2 c) \text {Ci}\left (2 d x^2\right )+\frac {1}{2} \left (2 a^2+b^2\right ) \log (x)+a b \text {Ci}\left (d x^2\right ) \sin (c)+a b \cos (c) \text {Si}\left (d x^2\right )+\frac {1}{4} b^2 \sin (2 c) \text {Si}\left (2 d x^2\right ) \]

[Out]

-1/4*b^2*Ci(2*d*x^2)*cos(2*c)+1/2*(2*a^2+b^2)*ln(x)+a*b*cos(c)*Si(d*x^2)+a*b*Ci(d*x^2)*sin(c)+1/4*b^2*Si(2*d*x
^2)*sin(2*c)

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3484, 6, 3459, 3457, 3456, 3458} \begin {gather*} \frac {1}{2} \left (2 a^2+b^2\right ) \log (x)+a b \sin (c) \text {CosIntegral}\left (d x^2\right )+a b \cos (c) \text {Si}\left (d x^2\right )-\frac {1}{4} b^2 \cos (2 c) \text {CosIntegral}\left (2 d x^2\right )+\frac {1}{4} b^2 \sin (2 c) \text {Si}\left (2 d x^2\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*Sin[c + d*x^2])^2/x,x]

[Out]

-1/4*(b^2*Cos[2*c]*CosIntegral[2*d*x^2]) + ((2*a^2 + b^2)*Log[x])/2 + a*b*CosIntegral[d*x^2]*Sin[c] + a*b*Cos[
c]*SinIntegral[d*x^2] + (b^2*Sin[2*c]*SinIntegral[2*d*x^2])/4

Rule 6

Int[(u_.)*((w_.) + (a_.)*(v_) + (b_.)*(v_))^(p_.), x_Symbol] :> Int[u*((a + b)*v + w)^p, x] /; FreeQ[{a, b}, x
] &&  !FreeQ[v, x]

Rule 3456

Int[Sin[(d_.)*(x_)^(n_)]/(x_), x_Symbol] :> Simp[SinIntegral[d*x^n]/n, x] /; FreeQ[{d, n}, x]

Rule 3457

Int[Cos[(d_.)*(x_)^(n_)]/(x_), x_Symbol] :> Simp[CosIntegral[d*x^n]/n, x] /; FreeQ[{d, n}, x]

Rule 3458

Int[Sin[(c_) + (d_.)*(x_)^(n_)]/(x_), x_Symbol] :> Dist[Sin[c], Int[Cos[d*x^n]/x, x], x] + Dist[Cos[c], Int[Si
n[d*x^n]/x, x], x] /; FreeQ[{c, d, n}, x]

Rule 3459

Int[Cos[(c_) + (d_.)*(x_)^(n_)]/(x_), x_Symbol] :> Dist[Cos[c], Int[Cos[d*x^n]/x, x], x] - Dist[Sin[c], Int[Si
n[d*x^n]/x, x], x] /; FreeQ[{c, d, n}, x]

Rule 3484

Int[((e_.)*(x_))^(m_.)*((a_.) + (b_.)*Sin[(c_.) + (d_.)*(x_)^(n_)])^(p_), x_Symbol] :> Int[ExpandTrigReduce[(e
*x)^m, (a + b*Sin[c + d*x^n])^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[p, 1] && IGtQ[n, 0]

Rubi steps

\begin {align*} \int \frac {\left (a+b \sin \left (c+d x^2\right )\right )^2}{x} \, dx &=\int \left (\frac {a^2}{x}+\frac {b^2}{2 x}-\frac {b^2 \cos \left (2 c+2 d x^2\right )}{2 x}+\frac {2 a b \sin \left (c+d x^2\right )}{x}\right ) \, dx\\ &=\int \left (\frac {a^2+\frac {b^2}{2}}{x}-\frac {b^2 \cos \left (2 c+2 d x^2\right )}{2 x}+\frac {2 a b \sin \left (c+d x^2\right )}{x}\right ) \, dx\\ &=\frac {1}{2} \left (2 a^2+b^2\right ) \log (x)+(2 a b) \int \frac {\sin \left (c+d x^2\right )}{x} \, dx-\frac {1}{2} b^2 \int \frac {\cos \left (2 c+2 d x^2\right )}{x} \, dx\\ &=\frac {1}{2} \left (2 a^2+b^2\right ) \log (x)+(2 a b \cos (c)) \int \frac {\sin \left (d x^2\right )}{x} \, dx-\frac {1}{2} \left (b^2 \cos (2 c)\right ) \int \frac {\cos \left (2 d x^2\right )}{x} \, dx+(2 a b \sin (c)) \int \frac {\cos \left (d x^2\right )}{x} \, dx+\frac {1}{2} \left (b^2 \sin (2 c)\right ) \int \frac {\sin \left (2 d x^2\right )}{x} \, dx\\ &=-\frac {1}{4} b^2 \cos (2 c) \text {Ci}\left (2 d x^2\right )+\frac {1}{2} \left (2 a^2+b^2\right ) \log (x)+a b \text {Ci}\left (d x^2\right ) \sin (c)+a b \cos (c) \text {Si}\left (d x^2\right )+\frac {1}{4} b^2 \sin (2 c) \text {Si}\left (2 d x^2\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.09, size = 71, normalized size = 0.96 \begin {gather*} \frac {1}{2} \left (2 a^2+b^2\right ) \log (x)-\frac {1}{4} b \left (b \cos (2 c) \text {Ci}\left (2 d x^2\right )-4 a \text {Ci}\left (d x^2\right ) \sin (c)-4 a \cos (c) \text {Si}\left (d x^2\right )-b \sin (2 c) \text {Si}\left (2 d x^2\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sin[c + d*x^2])^2/x,x]

[Out]

((2*a^2 + b^2)*Log[x])/2 - (b*(b*Cos[2*c]*CosIntegral[2*d*x^2] - 4*a*CosIntegral[d*x^2]*Sin[c] - 4*a*Cos[c]*Si
nIntegral[d*x^2] - b*Sin[2*c]*SinIntegral[2*d*x^2]))/4

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 4.
time = 0.27, size = 157, normalized size = 2.12

method result size
risch \(-\frac {{\mathrm e}^{-i c} \pi \,\mathrm {csgn}\left (d \,x^{2}\right ) a b}{2}+{\mathrm e}^{-i c} \sinIntegral \left (d \,x^{2}\right ) a b -\frac {i {\mathrm e}^{-i c} \expIntegral \left (1, -i d \,x^{2}\right ) a b}{2}+\ln \left (x \right ) a^{2}+\frac {\ln \left (x \right ) b^{2}}{2}-\frac {i \pi \,\mathrm {csgn}\left (d \,x^{2}\right ) {\mathrm e}^{-2 i c} b^{2}}{8}+\frac {i {\mathrm e}^{-2 i c} \sinIntegral \left (2 d \,x^{2}\right ) b^{2}}{4}+\frac {{\mathrm e}^{-2 i c} \expIntegral \left (1, -2 i d \,x^{2}\right ) b^{2}}{8}+\frac {b^{2} {\mathrm e}^{2 i c} \expIntegral \left (1, -2 i d \,x^{2}\right )}{8}+\frac {i a b \,{\mathrm e}^{i c} \expIntegral \left (1, -i d \,x^{2}\right )}{2}\) \(157\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sin(d*x^2+c))^2/x,x,method=_RETURNVERBOSE)

[Out]

-1/2*exp(-I*c)*Pi*csgn(d*x^2)*a*b+exp(-I*c)*Si(d*x^2)*a*b-1/2*I*exp(-I*c)*Ei(1,-I*d*x^2)*a*b+ln(x)*a^2+1/2*ln(
x)*b^2-1/8*I*Pi*csgn(d*x^2)*exp(-2*I*c)*b^2+1/4*I*exp(-2*I*c)*Si(2*d*x^2)*b^2+1/8*exp(-2*I*c)*Ei(1,-2*I*d*x^2)
*b^2+1/8*b^2*exp(2*I*c)*Ei(1,-2*I*d*x^2)+1/2*I*a*b*exp(I*c)*Ei(1,-I*d*x^2)

________________________________________________________________________________________

Maxima [C] Result contains complex when optimal does not.
time = 0.41, size = 108, normalized size = 1.46 \begin {gather*} -\frac {1}{2} \, {\left ({\left (i \, {\rm Ei}\left (i \, d x^{2}\right ) - i \, {\rm Ei}\left (-i \, d x^{2}\right )\right )} \cos \left (c\right ) - {\left ({\rm Ei}\left (i \, d x^{2}\right ) + {\rm Ei}\left (-i \, d x^{2}\right )\right )} \sin \left (c\right )\right )} a b - \frac {1}{8} \, {\left ({\left ({\rm Ei}\left (2 i \, d x^{2}\right ) + {\rm Ei}\left (-2 i \, d x^{2}\right )\right )} \cos \left (2 \, c\right ) - {\left (-i \, {\rm Ei}\left (2 i \, d x^{2}\right ) + i \, {\rm Ei}\left (-2 i \, d x^{2}\right )\right )} \sin \left (2 \, c\right ) - 4 \, \log \left (x\right )\right )} b^{2} + a^{2} \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x^2+c))^2/x,x, algorithm="maxima")

[Out]

-1/2*((I*Ei(I*d*x^2) - I*Ei(-I*d*x^2))*cos(c) - (Ei(I*d*x^2) + Ei(-I*d*x^2))*sin(c))*a*b - 1/8*((Ei(2*I*d*x^2)
 + Ei(-2*I*d*x^2))*cos(2*c) - (-I*Ei(2*I*d*x^2) + I*Ei(-2*I*d*x^2))*sin(2*c) - 4*log(x))*b^2 + a^2*log(x)

________________________________________________________________________________________

Fricas [A]
time = 0.38, size = 94, normalized size = 1.27 \begin {gather*} \frac {1}{4} \, b^{2} \sin \left (2 \, c\right ) \operatorname {Si}\left (2 \, d x^{2}\right ) + a b \cos \left (c\right ) \operatorname {Si}\left (d x^{2}\right ) - \frac {1}{8} \, {\left (b^{2} \operatorname {Ci}\left (2 \, d x^{2}\right ) + b^{2} \operatorname {Ci}\left (-2 \, d x^{2}\right )\right )} \cos \left (2 \, c\right ) + \frac {1}{2} \, {\left (2 \, a^{2} + b^{2}\right )} \log \left (x\right ) + \frac {1}{2} \, {\left (a b \operatorname {Ci}\left (d x^{2}\right ) + a b \operatorname {Ci}\left (-d x^{2}\right )\right )} \sin \left (c\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x^2+c))^2/x,x, algorithm="fricas")

[Out]

1/4*b^2*sin(2*c)*sin_integral(2*d*x^2) + a*b*cos(c)*sin_integral(d*x^2) - 1/8*(b^2*cos_integral(2*d*x^2) + b^2
*cos_integral(-2*d*x^2))*cos(2*c) + 1/2*(2*a^2 + b^2)*log(x) + 1/2*(a*b*cos_integral(d*x^2) + a*b*cos_integral
(-d*x^2))*sin(c)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (a + b \sin {\left (c + d x^{2} \right )}\right )^{2}}{x}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x**2+c))**2/x,x)

[Out]

Integral((a + b*sin(c + d*x**2))**2/x, x)

________________________________________________________________________________________

Giac [A]
time = 2.76, size = 77, normalized size = 1.04 \begin {gather*} -\frac {1}{4} \, b^{2} \cos \left (2 \, c\right ) \operatorname {Ci}\left (2 \, d x^{2}\right ) + a b \operatorname {Ci}\left (d x^{2}\right ) \sin \left (c\right ) + a b \cos \left (c\right ) \operatorname {Si}\left (d x^{2}\right ) - \frac {1}{4} \, b^{2} \sin \left (2 \, c\right ) \operatorname {Si}\left (-2 \, d x^{2}\right ) + \frac {1}{2} \, a^{2} \log \left (d x^{2}\right ) + \frac {1}{4} \, b^{2} \log \left (d x^{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x^2+c))^2/x,x, algorithm="giac")

[Out]

-1/4*b^2*cos(2*c)*cos_integral(2*d*x^2) + a*b*cos_integral(d*x^2)*sin(c) + a*b*cos(c)*sin_integral(d*x^2) - 1/
4*b^2*sin(2*c)*sin_integral(-2*d*x^2) + 1/2*a^2*log(d*x^2) + 1/4*b^2*log(d*x^2)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (a+b\,\sin \left (d\,x^2+c\right )\right )}^2}{x} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*sin(c + d*x^2))^2/x,x)

[Out]

int((a + b*sin(c + d*x^2))^2/x, x)

________________________________________________________________________________________